home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.4 / CAMD / include / midi / realtime.i < prev    next >
Encoding:
Text File  |  1992-10-30  |  5.0 KB  |  161 lines

  1.     ifnd    MIDI_REALTIME_I
  2. MIDI_REALTIME_I set 1
  3.  
  4. *************************************************************************
  5. *     RealTime Library (timing & syncing system)                        *
  6. *************************************************************************
  7. *                                                                       *
  8. * Design & Development  - Talin & Joe Pearce                            *
  9. *                                                                       *
  10. * Copyright 1992 by Commodore Business Machines                         *
  11. *************************************************************************
  12. *
  13. * realtime.h  - RealTime conductor/player include file.
  14. *
  15. *************************************************************************
  16.  
  17.     ifnd    EXEC_TYPES_I
  18.     include "exec/types.i"
  19.     endc
  20.  
  21.     ifnd    EXEC_MACROS_I
  22.     include "exec/macros.i"
  23.     endc
  24.  
  25.     ifnd    EXEC_NODES_I
  26.     include "exec/nodes.i"
  27.     endc
  28.  
  29.     ifnd    EXEC_LISTS_I
  30.     include "exec/lists.i"
  31.     endc
  32.  
  33.     ifnd    UTILITY_TAGITEM_I
  34.     include "utility/tagitem.i"
  35.     endc
  36.  
  37.     ifnd    UTILITY_HOOKS_I
  38.     include "utility/hooks.i"
  39.     endc
  40.  
  41.  
  42. * Each Conductor represents a group of applications which wish to remain
  43. * synchronized together.
  44. *
  45.  
  46.     STRUCTURE Conductor,LN_SIZE
  47.     UWORD    cdt_nodepad
  48.     STRUCT    cdt_Players,MLH_SIZE    ; list of players
  49.     ULONG    cdt_ClockTime        ; current time of this sequence
  50.     ULONG    cdt_StartTime        ; start time of this sequence
  51.     ULONG    cdt_ExternalTime    ; time from external unit
  52.     ULONG    cdt_MaxExternalTime    ; upper limit on sync'd time
  53.     ULONG    cdt_Metronome        ; metronome time of highest pri node
  54.      UWORD    cdt_PlayersNotReady    ; count of players not ready
  55.     UWORD    cdt_Flags        ; clock flags
  56.     UBYTE    cdt_State        ; playing or stopped
  57.         UBYTE    cdt_Stopped        ; quick running check
  58.     LABEL    Conductor_Size
  59.  
  60.     BITDEF  CONDUCT,EXTERNAL,0        ; clock is externally driven
  61.     BITDEF  CONDUCT,GOTTICK,1        ; received 1st external tick
  62.     BITDEF  CONDUCT,METROSET,2        ; if Metronone has been filled in
  63.  
  64.     ENUM    0
  65.  
  66.     EITEM   CLOCKSTATE_STOPPED        ; clock is stopped
  67.     EITEM   CLOCKSTATE_PAUSED        ; clock is paused
  68.     EITEM   CLOCKSTATE_LOCATE        ; go to 'running' when ready
  69.     EITEM   CLOCKSTATE_RUNNING        ; run clock NOW
  70.  
  71. CLOCKSTATE_METRIC  EQU  -1        ; ask high node to locate
  72. CLOCKSTATE_SHUTTLE EQU  -2        ; tie changing but not running
  73.  
  74.     BITDEF  CONDSTOP,STOPPED,0        ; not running state
  75.     BITDEF  CONDSTOP,NOTICK,1        ; extsync & not gottick
  76.  
  77. * The PlayerInfo is the connetion between a Conductor and an application.
  78. *
  79.  
  80.     STRUCTURE PlayerInfo,LN_SIZE
  81.     UWORD    pi_nodepad
  82.     APTR    pi_Hook            ; callback for player
  83.         APTR     pi_Source;        ; pointer to parent context
  84.     APTR    pi_Task;        ; task to signal for changes
  85.         LONG    pi_MetricTime;        ; current time in app's metric
  86.         LONG    pi_AlarmTime;        ; time to wake up
  87.         APTR    pi_UserData;        ; for application use
  88.         UWORD    pi_PlayerID;        ; for application use
  89.         UWORD    pi_Flags;        ; general PlayerInfo flags
  90.     STRUCT    pi_Reserved,2*4        ; internal use
  91.     BYTE    pi_AlarmSigBit;        ; signal to send for alarms
  92.     LABEL    PlayerInfo_Size
  93.  
  94.     BITDEF  PLAYER,READY,0        ; player is ready to go!
  95.     BITDEF  PLAYER,ALARMSET,1        ; alarm is set
  96.     BITDEF  PLAYER,QUIET,2        ; a dummy player, used for sync
  97.     BITDEF  PLAYER,CONDUCTED,3        ; give me metered time
  98.     BITDEF  PLAYER,EXTSYNC,4        ; granted external sync
  99.  
  100.     ENUM    TAG_USER+65
  101.  
  102.     EITEM   PLAYER_Hook            ; set address of hook function
  103.     EITEM   PLAYER_Name            ; name of player
  104.     EITEM   PLAYER_Priority        ; priority of player
  105.     EITEM   PLAYER_Conductor        ; set conductor for player
  106.                     ; if ~0, create private conductor
  107.     EITEM   PLAYER_Ready        ; the "ready" flag
  108.     EITEM   PLAYER_SignalTask        ; task to signal for alarm/state change
  109.     EITEM   PLAYER_Conducted        ; sets/clears CONDUCTED flag
  110.     EITEM   PLAYER_AlarmSigBit          ; signal bit for alarm (or -1)
  111.     EITEM   PLAYER_Quiet        ; don't process time thru this
  112.     EITEM   PLAYER_UserData
  113.     EITEM   PLAYER_ID
  114.     EITEM   PLAYER_AlarmTime        ; alarm time (sets PLAYERF_ALARMSET)
  115.     EITEM   PLAYER_AlarmOn        ; sets/clears ALARMSET flag
  116.     EITEM   PLAYER_ExtSync         ; attempt/release to ext sync
  117.  
  118.     EITEM   PLAYER_ErrorCode         ; error return code
  119.  
  120. * Mesages sent via PlayerInfo hook.
  121. *
  122.  
  123.     ENUM    0
  124.  
  125.     EITEM   PM_TICK
  126.     EITEM   PM_STATE
  127.     EITEM   PM_POSITION
  128.     EITEM   PM_SHUTTLE
  129.  
  130.     STRUCTURE pmTime,0
  131.     ULONG    pmt_Method
  132.     ULONG    pmt_Time
  133.     LABEL    pmTime_Size
  134.  
  135.     STRUCTURE pmState,0
  136.     ULONG    pms_Method
  137.     ULONG    pms_OldState
  138.     LABEL    pmState_Size
  139.  
  140. ****************************************************************
  141. *
  142. *   RealTime internal lists that can be locked
  143. *
  144. ****************************************************************
  145.  
  146.     ENUM
  147.     EITEM   RT_Conductors                       ; conductor list
  148.     EITEM   RT_NLocks
  149.  
  150. ****************************************************************
  151. *
  152. *   RealTime Error Codes
  153. *
  154. ***************************************************************/
  155.  
  156. RTE_NoMem        equ   801       ; memory allocation failed
  157. RTE_NoSignals    equ   802       ; signal allocation failed
  158. RTE_NoTimer      equ   803       ; timer (CIA) allocation failed
  159.  
  160.     endc
  161.